<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  
  <script>
  
    function getMaxNum(num1,num2) {
     var maxNum= num1>num2?num1:num2
     return maxNum
    }

    console.log(getMaxNum(12,4))
  
    function getSum(num1,num2) {
     var sum=num1+num2
     return sum
    }
    
    console.log(getSum(12,4))
    

  
    function getArrayMaxNum(ary) {
      var maxNum1=ary[0]
     for(var i=1;i<ary.length;i++){
          if(ary[i]>maxNum1){
            maxNum1=ary[i]
          }
     }
     return maxNum1
     
    }
    var ary1=[1,4,6,8,13,2]
  console.log(getArrayMaxNum(ary1))

  </script>
</body>
</html>